﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLZJFurnitureSCM.DAL;
using QLZJFurnitureSCM.Model;

namespace QLZJFurnitureSCM.BLL
{
    public class EmployeeService
    {
        private IBaseDAO<Employee> baseDAO = new EmployeeDAO();

        public List<Employee> FindAllEmployee()
        {
            return baseDAO.ReadAll();
        }

        public Employee Insert(Employee employee)
        {
            return baseDAO.Create(employee);
        }

        public bool Update(Employee employee)
        {
            return baseDAO.Update(employee);
        }

        public bool Delete(Employee employee)
        {
            return baseDAO.Delete(employee);
        }

        public bool DeleteBatch(List<Employee> lstEmployee)
        {
            foreach (Employee employee in lstEmployee)
            {
                if (!Delete(employee))
                    return false;
            }
            return true;
        }
        
    }
}
